home *** CD-ROM | disk | FTP | other *** search
- package java.io;
-
- class ObjectStreamField {
- String name;
- char type;
- int offset;
- String typeString;
-
- ObjectStreamField() {
- }
-
- ObjectStreamField(String n, char t, int o, String ts) {
- this.name = n;
- this.type = t;
- this.offset = o;
- this.typeString = ts;
- }
-
- int compare(ObjectStreamField other) {
- boolean thisprim = this.typeString == null;
- boolean otherprim = other.typeString == null;
- if (thisprim != otherprim) {
- return thisprim ? -1 : 1;
- } else {
- return this.name.compareTo(other.name);
- }
- }
-
- boolean isPrimitive() {
- return this.type != '[' && this.type != 'L';
- }
-
- public String toString() {
- return this.typeString != null ? this.typeString + " " + this.name + " @" + this.offset : this.type + " " + this.name + " @" + this.offset;
- }
-
- boolean typeEquals(ObjectStreamField other) {
- if (other != null && this.type == other.type) {
- return this.typeString == null && other.typeString == null ? true : ObjectStreamClass.compareClassNames(this.typeString, other.typeString, '/');
- } else {
- return false;
- }
- }
- }
-